$(function () {

    // 用户基本信息编辑按钮
    $(".editer").click(function () {
        $(".editer_personal_info").attr("id", "persion_info_show");
        $("#personal_data").css("display", "none");
    })

    // 用户基本信息提交按钮
    $("#btn-personal_info").click(function () {

        $(".editer_personal_info").attr("id", "personal_info_editer");
        $("#personal_data").css("display", "block");
    })

    // 用户基本信息取消按钮
    $("#cancel_submit").click(function () {
        $(".editer_personal_info").attr("id", "personal_info_editer");
        $("#personal_data").css("display", "block");
    })


    // 用户添加求职意向
    $("#apply_job").click(function () {
        $("#personal_job_info").css("display", "flex");
        $("#apply_job").css("display", "none");
    })

    // 求职提交按钮
    $(".personal_job_info>.layui-input-block>#btn-personal_info").click(function () {
        console.log("a");
        $("#apply_job").css("display", "block");
        $("#personal_job_info").css("display", "none");
    })

    // 求职取消按钮
    $(".personal_job_info>.layui-input-block>#cancel_submit").click(function () {
        $("#apply_job").css("display", "block");
        $("#personal_job_info").css("display", "none");
    })


    // 用户添加工作经历
    $(".data2").click(function () {
        $("#personal_info_experience").css("display", "flex");
        $(".data2").css("display", "none");
    })

    // 添加工作经历提交按钮
    $(".editer_personal_experience>.layui-input-block>#btn-personal_info").click(function () {
        console.log("a");
        $(".data2").css("display", "block");
        $("#personal_info_experience").css("display", "none");
    })

    // 添加工作经历取消按钮
    $(".editer_personal_experience>.layui-input-block>#cancel_submit").click(function () {
        $(".data2").css("display", "block");
        $("#personal_info_experience").css("display", "none");
    })


    //用户添加项目经历

    $(".data3").click(function () {
        $("#Project_experience").css("display", "flex");
        $(".data3").css("display", "none");
    })

    // 添加项目提交按钮
    $("#Project_experience>.layui-input-block>#btn-personal_info").click(function () {
        console.log("a");
        $(".data3").css("display", "block");
        $("#Project_experience").css("display", "none");
    })

    // 添加项目取消按钮
    $("#Project_experience>.layui-input-block>#cancel_submit").click(function () {
        $(".data3").css("display", "block");
        $("#Project_experience").css("display", "none");
    })


    //用户添加教育经历

    $(".data4").click(function () {
        $("#education_experience").css("display", "flex");
        $(".data4").css("display", "none");
    })

    // 添加教育提交按钮
    $("#education_experience>.layui-input-block>#btn-personal_info").click(function () {
        console.log("a");
        $(".data4").css("display", "block");
        $("#education_experience").css("display", "none");
    })

    // 添加教育取消按钮
    $("#education_experience>.layui-input-block>#cancel_submit").click(function () {
        $(".data4").css("display", "block");
        $("#education_experience").css("display", "none");
    })


    //用户添加个人网站技能

    $(".data5").click(function () {
        $("#Personal_ability").css("display", "flex");
        $(".data5").css("display", "none");
    })

    // 添加个人网站技能提交按钮
    $("#Personal_ability>.layui-input-block>#btn-personal_info").click(function () {
        console.log("a");
        $(".data5").css("display", "block");
        $("#Personal_ability").css("display", "none");
    })

    // 添加个人网站技能取消按钮
    $("#Personal_ability>.layui-input-block>#cancel_submit").click(function () {
        $(".data5").css("display", "block");
        $("#Personal_ability").css("display", "none");
    })



    //点击显示个人资料
    $("#personal_info_go").click(function(){
        
        $(".personal_info_right_info").css("display","flex");
        $(".favorites").css("display","none");

    })
   
    //点击显示收藏夹
    
    $("#favorites_btn").click(function(){
        $(".personal_info_right_info").css("display","none");
        
        $(".favorites").css("display","flex");
    })




    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('favorites_pic'), null, {
        width: 400,
        height: 400
    });
    var option = {
        series: [{
            type: 'pie',
            data: [{
                    value: 335,
                    name: '直接访问'
                },
                {
                    value: 234,
                    name: '联盟广告'
                },
                {
                    value: 1548,
                    name: '搜索引擎'
                }
            ],
            radius: '50%'
        }]
    };
    myChart.setOption(option);
});